'use strict'

class  attention{
  
  constructor () {

  }
  //是否关注
  async list (c) {
    let wuser = c.service.model.attention
    let ulist = await wuser.select(c.query.userid,c.query.attentionid)
    c.send(ulist)
  }
  
  async delete(c){
    let userid=c.param.userid
    let data=JSON.parse(c.body)
    let wuser = c.service.model.attention
    await wuser.delete(userid,data.attentionid)
  }

  async post(c){
    let data=JSON.parse(c.body)
    let wuser = c.service.model.attention
    await wuser.insert(data)
  }

}

module.exports = attention